package financial.sharing.center.common.enums;

/**
 * @ClassName ContractStageEnum
 * @Description 合同状态
 * @Author guoyuhang
 * @ @csdn https://blog.csdn.net/qq_40788718
 * @Date 2021/4/5
 * @Version 1.0
 */
public enum ContractStageEnum {

    无("无", 0),
    未签约("未签约", 1),
    签约中("签约中", 2),
    已签约("已签约", 3),
    合约中("合约中", 4),
    已结束("已结束", 5);

    private final String name;
    private final Integer value;

    ContractStageEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return this.name;
    }

    public Integer getValue() {
        return this.value;
    }

    public static ContractStageEnum name2Enum(String value) {
        for (ContractStageEnum enumName : ContractStageEnum.values()) {
            if(enumName.getName().equals(value)) {
                return enumName;
            }
        }
        return null;
    }

    public static ContractStageEnum int2Enum(Integer value) {
        for (ContractStageEnum enumName : ContractStageEnum.values()) {
            if(enumName.getValue().equals(value)) {
                return enumName;
            }
        }
        return null;
    }
}
